package com.fshuqing.learing.spring.mvc.requestparamters.controller;
import com.alibaba.fastjson.JSON;
import com.fshuqing.learing.spring.mvc.requestparamters.bean.Classroom;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author xiaoshyang mail: fanshuqing@fissionjoy.com
 * @version V1.0
 * @package com.fshuqing.learing.spring.mvc.requestparamters.controller
 * @date 2018/8/13
 * @description:
 */
@RestController
@RequestMapping("/classroom")
public class ClassRoomController {


    // http://localhost:8080/classroom/user?userMap[0].name=123&userMap[1].name=456&users[0].name=aaa&users[1].name=bb
    @GetMapping("/user")
    public String user(Classroom classroom) {
        String jsonString = JSON.toJSONString(classroom);
        System.out.println("jsonString = " + jsonString);
        return jsonString;
    }

}
